import {BasicColumn} from '/@/components/Table';
import {FormSchema} from '/@/components/Table';
import { rules} from '/@/utils/helper/validator';
import { render } from '/@/utils/common/renderUtils';
//列表数据
export const columns: BasicColumn[] = [
   {
    title: '项目名称',
    align:"left",
    dataIndex: 'projectName',
     width: 400
   },
  {
    title: '项目Id',
    align:"left",
    dataIndex: 'projectId'
  },
  {
    title: '项目序号',
    align:"left",
    dataIndex: 'sortNo'
  },
  {
    title: '项目状态',
    align:"center",
    dataIndex: 'status_dictText',
    width: 120
  },
/*  {
    title: '项目类型',// 1 roc类 2 hr 3 oop',
    align:"center",
    dataIndex: 'type_dictText',
    width: 100
  },*/
  {
    title: 'ROC类型',// 1 roc类 2 hr 3 oop',
    align:"center",
    dataIndex: 'rocType_dictText',
     width: 100
   },
   {
    title: '起始时间',
    align:"center",
    dataIndex: 'startTime',
     width: 100
   },
  {
    title: '结束时间',
    align:"center",
    dataIndex: 'endTime',
    width: 100
  },
/*  {
    title: '项目周期',
    align:"center",
    dataIndex: 'cycle',
    width: 90
  },
  {
    title: '完成度',
    align:"center",
    dataIndex: 'finishPercent',
    width: 90
  },*/
   {
    title: '合同额',
    align:"center",
    dataIndex: 'contractAmount',
     width: 100,
     format(_,record){
       return (record.contractAmount).toFixed(0)
     },
   },
  {
    title: '不含税合同额',
    align:"center",
    dataIndex: 'contractAmountWithoutFax',
    width: 100,
    format(_,record){
      return (record.contractAmountWithoutFax).toFixed(0)
    },
  },
  {
    title: '运营成本',
    align:"center",
    dataIndex: 'operationAmount',
    width: 100,
    format(_,record){
      return (record.operationAmount).toFixed(0)
    },
  },
  {
    title: '运营占比',
    align:"center",
    dataIndex: 'operationPercent',
    width: 100
  },
  {
    title: '人力成本预算',
    align:"center",
    dataIndex: 'hrCost',
    width: 100
  },
  {
    title: '已使用第三方费用',
    align:"center",
    dataIndex: 'supAmount',
    width: 100
  },
  {
    title: '剩余第三方费用',
    align:"center",
    dataIndex: 'remainingSupConsume',
    width: 100
  },
  {
    title: '已使用差旅费用',
    align:"center",
    dataIndex: 'tripAmount',
    width: 100
  },
  {
    title: '剩余差旅费用',
    align:"center",
    dataIndex: 'remainingTripAmount',
    width: 100
  },

  /*{
    title: '利润',
    align:"center",
    dataIndex: 'kpiAmount',
    width: 100,
    format(_,record){
      return (record.kpiAmount).toFixed(0)
    },
  },
  {
    title: '利润占比',
    align:"center",
    dataIndex: 'kpi',
    width: 100
  },
  {
    title: '当月差旅费用',
    align:"center",
    dataIndex: 'currentMonthTripConsume',
    format(_,record){
      return (record.currentMonthTripConsume).toFixed(0)
    },
  },
  {
    title: '当月第三方费用',
    align:"center",
    dataIndex: 'currentMonthSupConsume',
    width: 120,
    format(_,record){
      return (record.currentMonthSupConsume).toFixed(0)
    },
  },
   {
    title: '当月人员费用',
    align:"center",
    dataIndex: 'currentMonthHrConsume',
     width: 120,
     format(_,record){
       return (record.currentMonthHrConsume).toFixed(0)
     },
   },

   {
    title: '当月利润',
    align:"center",
    dataIndex: 'currentMonthProfit',
     width: 200,
     format(_,record){
       return (record.currentMonthProfit).toFixed(0)
     },
   },*/
   {
    title: '当前项目利润额',
    align:"center",
    dataIndex: 'historyTotalProfit',
     format(_,record){
       return (record.historyTotalProfit).toFixed(0)
     },
   },
  {
    title: '当前项目利润率',
    align:"center",
    dataIndex: 'profitPercent',
    width: 100
  },
/*   {
    title: '状态',// 1  立项中 2 立项完成 3 项目结束 ',
    align:"center",
    dataIndex: 'profitStatus'
   },*/
];
//查询数据
export const searchFormSchema: FormSchema[] = [
  {
    label: '项目名称',
    field: 'projectName',
    component: 'JInput',
    colProps: { span: 4 },
  },
  {
    label: '项目序号',
    field: 'sortNo',
    component: 'JInput',
    colProps: { span: 4 },
  },
  {
    field: 'customId',
    component: 'JDictSelectTag',
    componentProps: {
      dictCode: 'monster_custom,name,id'
    },
    label: '所属客户',
    colProps: { span: 4 },
  },
  {
    label: '项目类型',
    field: 'rocType',
    component: 'JDictSelectTag',
    componentProps: {
      dictCode: 'projectType',
      stringToNumber: true,
    },
    colProps: { span: 3 },
  },

  {
    label: '项目状态',
    field: 'status',
    component: 'JDictSelectTag',
    componentProps: {
      dictCode: 'projectStatus',
      stringToNumber: true,
    },
    colProps: { span: 4 },
  },

  {
    field: 'pm',
    component: 'JDictSelectTag',
    componentProps: {
      dictCode: 'sys_user,realname,username'
    },
    label: '项目经理',
    colProps: { span: 4 },
  },

];
//表单数据
export const formSchema: FormSchema[] = [
  {
    label: '项目',
    field: 'projectId',
    component: 'JDictSelectTag',
    componentProps: {
      dictCode: 'monster_roc_project_setup,project_name,id'
    },
  },
  {
    label: '项目状态',// 1  立项中 2 立项完成 3 项目结束 ',
    field: 'status',
    component: 'InputNumber',
  },
  {
    label: '项目类型',// 1 roc类 2 hr 3 oop',
    field: 'type',
    component: 'InputNumber',
  },
  {
    label: '总成本预算',
    field: 'totalAmount',
    component: 'InputNumber',
  },
  {
    label: '月份预算',
    field: 'monthAmount',
    component: 'InputNumber',
  },
  {
    label: '本月已用预算',
    field: 'currentMonthAmountCost',
    component: 'InputNumber',
  },
  {
    label: '运营成本',
    field: 'operationCost',
    component: 'InputNumber',
  },
  {
    label: '运供应占比',
    field: 'operationPercent',
    component: 'InputNumber',
  },
  {
    label: '合同额',
    field: 'contractAmount',
    component: 'InputNumber',
  },
  {
    label: '税点',
    field: 'fax',
    component: 'InputNumber',
  },
  {
    label: '利润',
    field: 'profit',
    component: 'InputNumber',
  },
  {
    label: 'kpi占比',
    field: 'kpi',
    component: 'InputNumber',
  },
  {
    label: '第三方总成本',
    field: 'supCost',
    component: 'InputNumber',
  },
  {
    label: '第三方总预算',
    field: 'supAmount',
    component: 'InputNumber',
  },
  {
    label: '人力预算',
    field: 'hrCost',
    component: 'InputNumber',
  },
  {
    label: '人力成本',
    field: 'hrAmount',
    component: 'InputNumber',
  },
  {
    label: '差旅预算',
    field: 'tripAmount',
    component: 'InputNumber',
  },
  {
    label: '差旅成本',
    field: 'tripCost',
    component: 'InputNumber',
  },
  {
    label: '其他预算',
    field: 'otherAmount',
    component: 'InputNumber',
  },
  {
    label: '其他成本',
    field: 'otherCost',
    component: 'InputNumber',
  },
	// TODO 主键隐藏字段，目前写死为ID
	{
	  label: '',
	  field: 'id',
	  component: 'Input',
	  show: false
	},
];



/**
* 流程表单调用这个方法获取formSchema
* @param param
*/
export function getBpmFormSchema(_formData): FormSchema[]{
  // 默认和原始表单保持一致 如果流程中配置了权限数据，这里需要单独处理formSchema
  return formSchema;
}
